function validatePIN(pin) {
    let a = pin.split("").filter(x=>Number.isInteger(Number.parseInt(x))).length
    let b = pin.length
    if(a==4||a==6) return a==b?true:false
    return false
}
console.log(validatePIN("00000"));
// console.log(Number.parseInt('-1.234').length);